# Generated by Django 4.2.1 on 2023-08-08 22:49

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='DataSource',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, help_text='UUID of the data source')),
                ('name', models.CharField(help_text='Name of the data source', max_length=100)),
                ('size', models.IntegerField(default=0, help_text='Size of the data source in bytes')),
                ('visibility', models.PositiveSmallIntegerField(choices=[(0, 'Private'), (1, 'Organization')], default=0, help_text='Visibility of the data source')),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now, help_text='Time when the data source was created')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Time when the data source was updated')),
                ('owner', models.ForeignKey(help_text='Owner of the data source', on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='DataSourceType',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Name of the data source type', max_length=100)),
                ('slug', models.CharField(default='', help_text='Slug of the data source type', max_length=50)),
                ('description', models.TextField(blank=True, default='', help_text='Description of the data source type')),
            ],
        ),
        migrations.CreateModel(
            name='DataSourceEntry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, help_text='UUID of the data source file')),
                ('config', models.JSONField(default=dict, help_text='Config for the data source entry')),
                ('name', models.CharField(blank=True, default='', help_text='Name of the data source file', max_length=2048)),
                ('size', models.IntegerField(default=0, help_text='Size of the entry in bytes')),
                ('status', models.CharField(choices=[('PROCESSING', 'Processing'), ('READY', 'Ready'), ('FAILED', 'Failed'), ('MARKED_FOR_DELETION', 'Marked for deletion')], default='PROCESSING', help_text='Status of the data source entry', max_length=100)),
                ('refresh_frequency', models.CharField(choices=[('DAILY', 'Daily'), ('WEEKLY', 'Weekly'), ('MONTHLY', 'Monthly'), ('YEARLY', 'Yearly'), ('ONCE', 'Once')], default='ONCE', help_text='Refresh frequency of the data source entry', max_length=100)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now, help_text='Time when the data source file was created')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Time when the data source file was updated')),
                ('datasource', models.ForeignKey(help_text='Data source', on_delete=django.db.models.deletion.DO_NOTHING, to='datasources.datasource')),
            ],
        ),
        migrations.AddField(
            model_name='datasource',
            name='type',
            field=models.ForeignKey(help_text='Type of the data source', on_delete=django.db.models.deletion.DO_NOTHING, to='datasources.datasourcetype'),
        ),
    ]
